/*
 * Copyright (C) 2013 Shanghai Paibo soft Co., Ltd
 *
 * All copyrights reserved by dalinggong.com
 * Any copying, transferring or any other usage is prohibited.
 * Or else, Shanghai Paibo possesses the right to require legal 
 * responsibilities from the violator.
 * All third-party contributions are distributed under license by
 * dalinggong soft Co., Ltd.
 */
package com.dlg.commons.enums;

/**
 * @author jiangchangcheng  2017年3月30日 下午9:22:27
 * @since JDK 1.7	
 */
public enum SourceEnum {

	ODD_JOB("oddjob", "打零工"),
	CX_HUTONG("cxht", "诚信互通"),
	GONGREN("gongren", "工人网"),
	OTHER("other", "其它");
	
	private String name;
	
	private String key;
	
	SourceEnum(String key, String name){
		this.key = key;
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}
	
	public static SourceEnum getEnumByName(String name){
		SourceEnum[] enums = SourceEnum.values();
		for(SourceEnum source: enums){
			if(name.equals(source.getName())){
				return source;
			}
		}
		throw new RuntimeException("不支持的系统来源");
	}
	
}
